package com.hzzh.service;

import java.sql.SQLException;
import java.util.ArrayList;

import com.hzzh.dao.DepartmentDAO;
import com.hzzh.vo.Department;

public class DepartmentService {
	//===========查询所有部门信息================
	public ArrayList<Department> selectAllDepartmentService() throws ClassNotFoundException, SQLException{
		DepartmentDAO dd = new DepartmentDAO();
		ArrayList<Department> al = dd.selectAllDepartmentDAO();
		return al;        
    }
	
	//===========增加部门================
	public void addDepartmentService(String departmentname) throws ClassNotFoundException, SQLException{
		DepartmentDAO dd = new DepartmentDAO();
		dd.insert(departmentname);
	}
	
	//===========删除部门================
	public void deleteDepartmentService(int departmentid) throws ClassNotFoundException, SQLException{
		DepartmentDAO dd = new DepartmentDAO();
        dd.delete(departmentid);
	}
}
